﻿using OneByOne.API;

namespace SmartBossPlugin
{
    public class Plugin : IPlugin
    {
        public Guid Guid => new Guid("1A71BBE9-976B-4592-8360-D53C75D217E7");

        public void OnFighting(IPlayer player, IEnemy enemy) { }

        private bool enabled = false;
        public void OnGameStart(IGameSettings settings, IPlayer player, IList<IEnemy> enemies)
        {
            this.enabled = (int)settings.Difficulty is >= (int)Difficulty.Hard;
            if (this.enabled)
            {
                var index = enemies.Count - 1;
                var boss = enemies[index];
                enemies.RemoveAt(index);

                boss.Name = "BOSS";
                enemies.Insert(0, boss);
            }
        }
        public void OnGameOver(int position, bool won)
        {
            if (!this.enabled)
                return;

            if (won)
                Console.WriteLine("什么？你怎么打过 Boss 的？");
            else
                Console.WriteLine("小辣鸡，打不过吧！哈哈哈哈哈哈哈哈哈");
        }
    }
}